home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / pc_mouse.arc / PC_MOUSE.PAS < prev   
Pascal/Delphi Source File  |  1991-04-28  |  14KB  |  652 lines

  1. Unit PC_Mouse ;
  2.  
  3. Interface
  4.  
  5. const
  6.    ResetTheMouse        = 0 ;
  7.    ShowCurs             = 1 ;
  8.    HideCurs             = 2 ;
  9.    GetStat              = 3 ;
  10.    SetCurs              = 4 ;
  11.    GetButtonPress       = 5 ;
  12.    GetButtonRelease     = 6 ;
  13.    SetMinMaxHoriz       = 7 ;
  14.    SetMinMaxVert        = 8 ;
  15.    SetGraphicsCursor    = 9 ;
  16.    SetTextCursor        = 10 ;
  17.    ReadMouseMotion      = 11 ;
  18.    SetUserInput         = 12 ;
  19.    EmulateLightPenOn    = 13 ;
  20.    EmulateLightPenOff   = 14 ;
  21.    SetMickeyPixelRatio  = 15 ;
  22.    ProtectCursorPos     = 16 ;
  23.    SetLargeGraphCurs    = 18 ;
  24.    SetDoubleSpeedThresh = 19 ;
  25.  
  26. Type
  27.    MouseStrings         = array[0..3] of string[19] ;
  28.  
  29. Const
  30.    MouseTypeText        : MouseStrings = ('Unknown Mouse Type',
  31.                                           'Unknown Mouse Type',
  32.                                           'Microsoft Mouse',
  33.                                           'Mouse Systems Mouse') ;
  34. Var
  35.    MouseType,
  36.    M1,
  37.    M2,
  38.    M3,
  39.    M4              : integer ;
  40.  
  41.    M5,
  42.    CursPtr,
  43.    AreaPtr         : Pointer ;
  44.  
  45.    Cursor          : Array[0..1,0..15] of word ;
  46.  
  47.    MousePresent    : Boolean ;
  48.  
  49.    Procedure ChangeGraphicsCursor ;
  50.    Procedure MakeScreenMask ;
  51.    Procedure FlipLRCursor ;
  52.    Procedure HourGlassCursor ;
  53.    Procedure ClockCursor ;
  54.    Procedure CircularCrossHairCursor ;
  55.    Procedure CrossHairCursor ;
  56.    Procedure CrossHair1Cursor ;
  57.    Procedure CrossHair2Cursor ;
  58.    Procedure CrossHair3Cursor ;
  59.    Procedure DotCursor ;
  60.    Procedure Arrow ;
  61.    Procedure ArrowCursor ;
  62.    Procedure RightArrowCursor ;
  63.    Procedure ShowCursor ;
  64.    Procedure ResetMouse ;
  65.    Procedure InitGraphicsMouse ;
  66.    Procedure GetMouseStat ;
  67.    Procedure GetLButton ;
  68.    Procedure GetRButton ;
  69.    Procedure GetMButton ;
  70.    Procedure PollMousePos ;
  71.    Procedure PositionGraphicsCursor (HorizCursorPos,VertCursorPos:integer) ;
  72.    Procedure PositionTextCursor (HorizCursorPos,VertCursorPos:integer) ;
  73.    Procedure SetVerticalLimits (MinVert,MaxVert:integer) ;
  74.    Procedure SetHorizontalLimits (MinHoriz,MaxHoriz:integer) ;
  75.    Procedure HideCursor ;
  76.    Procedure ProtectArea (AreaPtr:pointer) ;
  77.    Procedure SetSoftCursor(ScreenMask, CursorMask:integer) ;
  78.    Function  LButtonPressed : boolean ;
  79.    Function  RButtonPressed : boolean;
  80.    Function  MButtonPressed : boolean;
  81.  
  82. Implementation
  83.  
  84. Uses DOS ;
  85.  
  86. const
  87.    LButton              = 0 ;
  88.    RButton              = 1 ;
  89.    MButton              = 2 ;
  90.  
  91.    High                 = 5000 ;
  92.    Med                  = 1000 ;
  93.    Low                  =  500 ;
  94.    VLow                 =  100 ;
  95.  
  96.  
  97. Procedure MouseTPL(var M1, M2, M3:integer; var M5:pointer); External ;
  98. {$L MOUSEM}
  99. Procedure MouseTP(var M1, M2, M3, M4:integer); External ;
  100. {$L MOUSE}
  101.  
  102.  
  103. Procedure ChangeGraphicsCursor ;
  104.  
  105. begin
  106.    M1 := SetGraphicsCursor ;
  107.    M5 := CursPtr ;
  108.    mousetpl(M1,M2,M3,M5) ;
  109. end ;
  110.  
  111.  
  112. Procedure MakeScreenMask ;
  113.  
  114. Var
  115.    i               : byte ;
  116.  
  117. begin
  118.    for i := 0 to 15 do Cursor[0,i] := (Cursor[1,i] XOR $FFFF) ;
  119. end ;
  120.  
  121.  
  122. Procedure FlipLRCursor ;
  123.  
  124. Var
  125.    i               : integer ;
  126.  
  127. begin
  128.    for i := 0 to 15 do begin
  129.       Cursor[1,i] := ((Cursor[1,i] AND $8000) shr 14) OR
  130.                      ((Cursor[1,i] AND $4000) shr 12) OR
  131.                      ((Cursor[1,i] AND $2000) shr 10) OR
  132.                      ((Cursor[1,i] AND $1000) shr  8) OR
  133.                      ((Cursor[1,i] AND $0800) shr  6) OR
  134.                      ((Cursor[1,i] AND $0400) shr  4) OR
  135.                      ((Cursor[1,i] AND $0200) shr  2) OR
  136.                       (Cursor[1,i] AND $0100)         OR
  137.                      ((Cursor[1,i] AND $0080) shl  2) OR
  138.                      ((Cursor[1,i] AND $0040) shl  4) OR
  139.                      ((Cursor[1,i] AND $0020) shl  6) OR
  140.                      ((Cursor[1,i] AND $0010) shl  8) OR
  141.                      ((Cursor[1,i] AND $0008) shl 10) OR
  142.                      ((Cursor[1,i] AND $0004) shl 12) OR
  143.                      ((Cursor[1,i] AND $0002) shl 14) OR
  144.                       (Cursor[1,i] AND $0001) ;
  145.  
  146.       Cursor[0,i] := ((Cursor[0,i] AND $8000) shr 14) OR
  147.                      ((Cursor[0,i] AND $4000) shr 12) OR
  148.                      ((Cursor[0,i] AND $2000) shr 10) OR
  149.                      ((Cursor[0,i] AND $1000) shr  8) OR
  150.                      ((Cursor[0,i] AND $0800) shr  6) OR
  151.                      ((Cursor[0,i] AND $0400) shr  4) OR
  152.                      ((Cursor[0,i] AND $0200) shr  2) OR
  153.                       (Cursor[0,i] AND $0100)         OR
  154.                      ((Cursor[0,i] AND $0080) shl  2) OR
  155.                      ((Cursor[0,i] AND $0040) shl  4) OR
  156.                      ((Cursor[0,i] AND $0020) shl  6) OR
  157.                      ((Cursor[0,i] AND $0010) shl  8) OR
  158.                      ((Cursor[0,i] AND $0008) shl 10) OR
  159.                      ((Cursor[0,i] AND $0004) shl 12) OR
  160.                      ((Cursor[0,i] AND $0002) shl 14) OR
  161.                       (Cursor[0,i] AND $0001) ;
  162.       end ;
  163. end ;
  164.  
  165.  
  166. Procedure HourGlassCursor ;
  167.  
  168. begin
  169.    Cursor[1, 0] := $FFFE ;
  170.    Cursor[1, 1] := $4004 ;
  171.    Cursor[1, 2] := $2008 ;
  172.    Cursor[1, 3] := $2828 ;
  173.    Cursor[1, 4] := $1450 ;
  174.    Cursor[1, 5] := $0AA0 ;
  175.    Cursor[1, 6] := $0540 ;
  176.    Cursor[1, 7] := $0380 ;
  177.    Cursor[1, 8] := $0540 ;
  178.    Cursor[1, 9] := $08A0 ;
  179.    Cursor[1,10] := $1110 ;
  180.    Cursor[1,11] := $2088 ;
  181.    Cursor[1,12] := $2088 ;
  182.    Cursor[1,13] := $4AA4 ;
  183.    Cursor[1,14] := $5554 ;
  184.    Cursor[1,15] := $FFFE ;
  185.  
  186.    MakeScreenMask ;
  187.  
  188.    M2 := 7 ;
  189.    M3 := 8 ;
  190.    ChangeGraphicsCursor ;
  191. end ;
  192.  
  193.  
  194. Procedure ClockCursor ;
  195.  
  196. begin
  197.    Cursor[1, 0] := $07C0 ;
  198.    Cursor[1, 1] := $07C0 ;
  199.    Cursor[1, 2] := $0FE0 ;
  200.    Cursor[1, 3] := $3938 ;
  201.    Cursor[1, 4] := $610C ;
  202.    Cursor[1, 5] := $610C ;
  203.    Cursor[1, 6] := $C105 ;
  204.    Cursor[1, 7] := $C107 ;
  205.    Cursor[1, 8] := $C085 ;
  206.    Cursor[1, 9] := $604C ;
  207.    Cursor[1,10] := $6018 ;
  208.    Cursor[1,11] := $3838 ;
  209.    Cursor[1,12] := $0FE0 ;
  210.    Cursor[1,13] := $07C0 ;
  211.    Cursor[1,14] := $07C0 ;
  212.    Cursor[1,15] := $0000 ;
  213.  
  214.    MakeScreenMask ;
  215.  
  216.    M2 := 7 ;
  217.    M3 := 7 ;
  218.    ChangeGraphicsCursor ;
  219. end ;
  220.  
  221.  
  222. Procedure CircularCrossHairCursor ;
  223.  
  224. begin
  225.    Cursor[1, 0] := $0FE0 ;
  226.    Cursor[1, 1] := $3118 ;
  227.    Cursor[1, 2] := $610C ;
  228.    Cursor[1, 3] := $4106 ;
  229.    Cursor[1, 4] := $C106 ;
  230.    Cursor[1, 5] := $8102 ;
  231.    Cursor[1, 6] := $8102 ;
  232.    Cursor[1, 7] := $FEFE ;
  233.    Cursor[1, 8] := $8102 ;
  234.    Cursor[1, 9] := $8102 ;
  235.    Cursor[1,10] := $C106 ;
  236.    Cursor[1,11] := $4106 ;
  237.    Cursor[1,12] := $610C ;
  238.    Cursor[1,13] := $3118 ;
  239.    Cursor[1,14] := $0FE0 ;
  240.    Cursor[1,15] := $0000 ;
  241.  
  242.    MakeScreenMask ;
  243.  
  244.    M2 := 7 ;
  245.    M3 := 7 ;
  246.    ChangeGraphicsCursor ;
  247. end ;
  248.  
  249.  
  250. Procedure CrossHairCursor ;
  251.  
  252. begin
  253.    Cursor[1, 0] := $0100 ;
  254.    Cursor[1, 1] := $0100 ;
  255.    Cursor[1, 2] := $0100 ;
  256.    Cursor[1, 3] := $0100 ;
  257.    Cursor[1, 4] := $0100 ;
  258.    Cursor[1, 5] := $0100 ;
  259.    Cursor[1, 6] := $0100 ;
  260.    Cursor[1, 7] := $0000 ;
  261.    Cursor[1, 8] := $FC7F ;
  262.    Cursor[1, 9] := $0000 ;
  263.    Cursor[1,10] := $0100 ;
  264.    Cursor[1,11] := $0100 ;
  265.    Cursor[1,12] := $0100 ;
  266.    Cursor[1,13] := $0100 ;
  267.    Cursor[1,14] := $0100 ;
  268.    Cursor[1,15] := $0100 ;
  269.  
  270.    MakeScreenMask ;
  271.  
  272.    M2 := 7 ;
  273.    M3 := 8 ;
  274.    ChangeGraphicsCursor ;
  275. end ;
  276.  
  277.  
  278. Procedure CrossHair1Cursor ;
  279.  
  280. begin
  281.    Cursor[1, 0] := $FFFE ;
  282.    Cursor[1, 1] := $C006 ;
  283.    Cursor[1, 2] := $A00A ;
  284.    Cursor[1, 3] := $9012 ;
  285.    Cursor[1, 4] := $8822 ;
  286.    Cursor[1, 5] := $8442 ;
  287.    Cursor[1, 6] := $8282 ;
  288.    Cursor[1, 7] := $8002 ;
  289.    Cursor[1, 8] := $8282 ;
  290.    Cursor[1, 9] := $8442 ;
  291.    Cursor[1,10] := $8822 ;
  292.    Cursor[1,11] := $9012 ;
  293.    Cursor[1,12] := $A00A ;
  294.    Cursor[1,13] := $C006 ;
  295.    Cursor[1,14] := $FFFE ;
  296.    Cursor[1,15] := $0000 ;
  297.  
  298.    MakeScreenMask ;
  299.  
  300.    M2 := 7 ;
  301.    M3 := 7 ;
  302.    ChangeGraphicsCursor ;
  303. end ;
  304.  
  305.  
  306. Procedure CrossHair2Cursor ;
  307.  
  308. begin
  309.    Cursor[1, 0] := $FFFE ;
  310.    Cursor[1, 1] := $C006 ;
  311.    Cursor[1, 2] := $A00A ;
  312.    Cursor[1, 3] := $9FF2 ;
  313.    Cursor[1, 4] := $9832 ;
  314.    Cursor[1, 5] := $9452 ;
  315.    Cursor[1, 6] := $9292 ;
  316.    Cursor[1, 7] := $9012 ;
  317.    Cursor[1, 8] := $9292 ;
  318.    Cursor[1, 9] := $9452 ;
  319.    Cursor[1,10] := $9832 ;
  320.    Cursor[1,11] := $9FF2 ;
  321.    Cursor[1,12] := $A00A ;
  322.    Cursor[1,13] := $C006 ;
  323.    Cursor[1,14] := $FFFE ;
  324.    Cursor[1,15] := $0000 ;
  325.  
  326.    MakeScreenMask ;
  327.  
  328.    M2 := 7 ;
  329.    M3 := 7 ;
  330.    ChangeGraphicsCursor ;
  331. end ;
  332.  
  333.  
  334. Procedure CrossHair3Cursor ;
  335.  
  336. begin
  337.    Cursor[1, 0] := $8002 ;
  338.    Cursor[1, 1] := $4004 ;
  339.    Cursor[1, 2] := $2008 ;
  340.    Cursor[1, 3] := $1010 ;
  341.    Cursor[1, 4] := $0820 ;
  342.    Cursor[1, 5] := $0440 ;
  343.    Cursor[1, 6] := $0000 ;
  344.    Cursor[1, 7] := $0000 ;
  345.    Cursor[1, 8] := $0000 ;
  346.    Cursor[1, 9] := $0440 ;
  347.    Cursor[1,10] := $0820 ;
  348.    Cursor[1,11] := $1010 ;
  349.    Cursor[1,12] := $2008 ;
  350.    Cursor[1,13] := $4004 ;
  351.    Cursor[1,14] := $8002 ;
  352.    Cursor[1,15] := $0000 ;
  353.  
  354.    MakeScreenMask ;
  355.  
  356.    M2 := 7 ;
  357.    M3 := 7 ;
  358.    ChangeGraphicsCursor ;
  359. end ;
  360.  
  361.  
  362. Procedure DotCursor ;
  363.  
  364. begin
  365.    Cursor[1, 0] := $0000 ;
  366.    Cursor[1, 1] := $0000 ;
  367.    Cursor[1, 2] := $0000 ;
  368.    Cursor[1, 3] := $0000 ;
  369.    Cursor[1, 4] := $0000 ;
  370.    Cursor[1, 5] := $0000 ;
  371.    Cursor[1, 6] := $0000 ;
  372.    Cursor[1, 7] := $0100 ;
  373.    Cursor[1, 8] := $0000 ;
  374.    Cursor[1, 9] := $0000 ;
  375.    Cursor[1,10] := $0000 ;
  376.    Cursor[1,11] := $0000 ;
  377.    Cursor[1,12] := $0000 ;
  378.    Cursor[1,13] := $0000 ;
  379.    Cursor[1,14] := $0000 ;
  380.    Cursor[1,15] := $0000 ;
  381.  
  382.    MakeScreenMask ;
  383.  
  384.    M2 := 7 ;
  385.    M3 := 7 ;
  386.    ChangeGraphicsCursor ;
  387. end ;
  388.  
  389.  
  390. Procedure Arrow ;
  391.  
  392. begin
  393.    Cursor[0, 0] := $9FFF ;
  394.    Cursor[0, 1] := $8FFF ;
  395.    Cursor[0, 2] := $87FF ;
  396.    Cursor[0, 3] := $83FF ;
  397.    Cursor[0, 4] := $81FF ;
  398.    Cursor[0, 5] := $80FF ;
  399.    Cursor[0, 6] := $807F ;
  400.    Cursor[0, 7] := $803F ;
  401.    Cursor[0, 8] := $801F ;
  402.    Cursor[0, 9] := $800F ;
  403.    Cursor[0,10] := $80FF ;
  404.    Cursor[0,11] := $887F ;
  405.    Cursor[0,12] := $987F ;
  406.    Cursor[0,13] := $FC3F ;
  407.    Cursor[0,14] := $FC3F ;
  408.    Cursor[0,15] := $FEFF ;
  409.  
  410.    Cursor[1, 0] := $0000 ;
  411.    Cursor[1, 1] := $2000 ;
  412.    Cursor[1, 2] := $3000 ;
  413.    Cursor[1, 3] := $3800 ;
  414.    Cursor[1, 4] := $3C00 ;
  415.    Cursor[1, 5] := $3E00 ;
  416.    Cursor[1, 6] := $3F00 ;
  417.    Cursor[1, 7] := $3F80 ;
  418.    Cursor[1, 8] := $3FC0 ;
  419.    Cursor[1, 9] := $3FE0 ;
  420.    Cursor[1,10] := $3E00 ;
  421.    Cursor[1,11] := $2300 ;
  422.    Cursor[1,12] := $0300 ;
  423.    Cursor[1,13] := $0180 ;
  424.    Cursor[1,14] := $0180 ;
  425.    Cursor[1,15] := $0000 ;
  426. end ;
  427.  
  428.  
  429. Procedure ArrowCursor ;
  430.  
  431. begin
  432.    Arrow ;
  433.    M2 :=  1 ;
  434.    M3 := -1 ;
  435.    ChangeGraphicsCursor ;
  436. end ;
  437.  
  438.  
  439. Procedure RightArrowCursor ;
  440.  
  441. begin
  442.    Arrow ;
  443.    FlipLRCursor ;
  444.    M2 := 13 ;
  445.    M3 := -1 ;
  446.    ChangeGraphicsCursor ;
  447. end ;
  448.  
  449.  
  450. Procedure ShowCursor ;
  451.  
  452. begin
  453.    M1 := ShowCurs ;
  454.    M2 := 0 ;
  455.    M3 := 0 ;
  456.    M4 := 0 ;
  457.    MouseTP(M1,M2,M3,M4) ;
  458. end ;
  459.  
  460.  
  461. Procedure ResetMouse ;
  462.  
  463. begin
  464.    M1 := ResetTheMouse ;
  465.    M2 := 0 ;
  466.    M3 := 0 ;
  467.    M4 := 0 ;
  468.    MouseTP(M1,M2,M3,M4) ;
  469.  
  470.    If (M1 = -1) then MousePresent := true
  471.                 else MousePresent := false ;
  472.  
  473.    Case M2 of
  474.       2    : MouseType := 2 ;
  475.       3    : MouseType := 3 ;
  476.       else   MouseType := 0 ;
  477.       end ;
  478. end ;
  479.  
  480.  
  481. Procedure InitGraphicsMouse ;
  482.  
  483. begin
  484.    ResetMouse ;
  485.    If MousePresent then begin
  486.       CursPtr := Addr(Cursor) ;
  487.       HourGlassCursor ;
  488.       ShowCursor ;
  489.       end ;
  490. end ;
  491.  
  492.  
  493. Procedure GetMouseStat ;
  494.  
  495. begin
  496.    M1 := GetStat ;
  497.    M2 := 0 ;
  498.    M3 := 0 ;
  499.    M4 := 0 ;
  500.    MouseTP(M1,M2,M3,M4) ;
  501. end ;
  502.  
  503.  
  504. Procedure GetLButton ;
  505.  
  506. begin
  507.    M1 := GetButtonPress ;
  508.    M2 := LButton ;
  509.    M3 := 0 ;
  510.    M4 := 0 ;
  511.    MouseTP(M1,M2,M3,M4) ;
  512. end ;
  513.  
  514.  
  515. Procedure GetRButton ;
  516.  
  517. begin
  518.    M1 := GetButtonPress ;
  519.    M2 := RButton ;
  520.    M3 := 0 ;
  521.    M4 := 0 ;
  522.    MouseTP(M1,M2,M3,M4) ;
  523. end ;
  524.  
  525.  
  526.  
  527. Procedure GetMButton ;
  528.  
  529. begin
  530.    M1 := GetButtonPress ;
  531.    M2 := MButton ;
  532.    M3 := 0 ;
  533.    M4 := 0 ;
  534.    MouseTP(M1,M2,M3,M4) ;
  535. end ;
  536.  
  537.  
  538. Procedure PollMousePos ;
  539.  
  540. begin
  541.    M1 := ReadMouseMotion ;
  542.    M2 := 0 ;
  543.    M3 := 0 ;
  544.    M4 := 0 ;
  545.    MouseTP(M1,M2,M3,M4) ;
  546. end ;
  547.  
  548.  
  549. Procedure PositionGraphicsCursor (HorizCursorPos,VertCursorPos:integer) ;
  550.  
  551. begin
  552.    M1 := SetCurs ;
  553.    M2 := 0 ;
  554.    M3 := HorizCursorPos ;
  555.    M4 := VertCursorPos ;
  556.    MouseTP(M1,M2,M3,M4) ;
  557. end ;
  558.  
  559.  
  560. Procedure PositionTextCursor (HorizCursorPos,VertCursorPos:integer) ;
  561.  
  562. begin
  563.    M1 := SetCurs ;
  564.    M2 := 0 ;
  565.    M3 := HorizCursorPos*8 ;
  566.    M4 := VertCursorPos*8 ;
  567.    MouseTP(M1,M2,M3,M4) ;
  568. end ;
  569.  
  570.  
  571. Procedure SetVerticalLimits (MinVert,MaxVert:integer) ;
  572.  
  573. begin
  574.    M1 := SetMinMaxVert ;
  575.    M2 := 0 ;
  576.    M3 := MinVert*8 ;
  577.    M4 := MaxVert*8 ;
  578.    MouseTP(M1,M2,M3,M4) ;
  579. end ;
  580.  
  581.  
  582. Procedure SetHorizontalLimits (MinHoriz,MaxHoriz:integer) ;
  583.  
  584. begin
  585.    M1 := SetMinMaxHoriz ;
  586.    M2 := 0 ;
  587.    M3 := MinHoriz*8 ;
  588.    M4 := MaxHoriz*8 ;
  589.    MouseTP(M1,M2,M3,M4) ;
  590. end ;
  591.  
  592.  
  593. Procedure HideCursor ;
  594.  
  595. begin
  596.    M1 := HideCurs ;
  597.    M2 := 0 ;
  598.    M3 := 0 ;
  599.    M4 := 0 ;
  600.    MouseTP(M1,M2,M3,M4) ;
  601. end ;
  602.  
  603.  
  604. Procedure ProtectArea (AreaPtr:pointer) ;
  605.  
  606. begin
  607.    M1 := ProtectCursorPos ;
  608.    M2 := 0 ;
  609.    M3 := 0 ;
  610.    M5 := AreaPtr ;
  611.    MouseTPL(M1,M2,M3,M5) ;
  612. end ;
  613.  
  614.  
  615. Procedure SetSoftCursor(ScreenMask,CursorMask: integer) ;
  616.  
  617. begin
  618.    M1 := SetTextCursor ;
  619.    M2 := 0 ;
  620.    M3 := ScreenMask ;
  621.    M4 := CursorMask ;
  622.    MouseTP(M1,M2,M3,M4) ;
  623. end ;
  624.  
  625.  
  626. Function LButtonPressed : boolean ;
  627.  
  628. begin
  629.    LButtonPressed := False ;
  630.    GetLButton ;
  631.    If (M2 > 0) then LButtonPressed := true ;
  632. end;
  633.  
  634.  
  635. Function MButtonPressed : boolean ;
  636.  
  637. begin
  638.    MButtonPressed := False ;
  639.    GetMButton ;
  640.    If (M2 > 0) then MButtonPressed := true ;
  641. end;
  642.  
  643.  
  644. Function RButtonPressed : boolean ;
  645.  
  646. begin
  647.    RButtonPressed := False ;
  648.    GetRButton ;
  649.    If (M2 > 0) then RButtonPressed := true ;
  650. end;
  651.  
  652. end.